/**
 * 遍历可迭代对象
 *  ● Array
 *  ● 伪数组
 *  ● String
 *  ● Map
 *  ● Set
 */
// Array >>>
var arr = [1, 2, 3]
for (var elem of arr) {
  console.log(elem)
}
// Array <<<

// 字符串 >>>
var str = 'Hello world!'
for (var c of str) {
  console.log(c)
}
// 字符串 <<<

// Map >>>
var map = new Map([
  ['A', 'a'],
  ['B', 'b'],
  ['C', 'c']
])
for (var elem of map) {
  var [key, value] = elem
  console.log(key, value)
}
// Map <<<

// Set >>>
var set = new Set([1, 2, 3])
for (var elem of set) {
  console.log(elem)
}
// Set <<<
